// use localStorage to store the authority info, which might be sent from server in actual project.
export function getAuthority() {
  const localToken = localStorage.getItem('cy-userToken');
  let res = null;
  if (localToken) {
    res = JSON.parse(localToken).token && JSON.parse(localToken).token.data.userToken;
  }
  return res || null;
}
export function getLocalUserInfo() {
  return localStorage.getItem('cy-userToken');
}
export function setAuthority(object) {
  return localStorage.setItem('cy-userToken', object);
}

export function delAuthority() {
  return localStorage.removeItem('cy-userToken');
}
